package com.kun.peng.generator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;

import java.io.Serializable;

/**
 * Created on 2021/11/16.
 *
 * @author xuebaopeng
 * Description 代码生成配置
 */
@Data
@NoArgsConstructor
@TableName("code_gen_config")
@ApiModel(value="代码配置表", description="代码配置表")
public class GenConfig implements Serializable {

    public GenConfig(String tableName) {
        this.tableName = tableName;
    }

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "config_id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "表名")
    @NotEmpty(message = "表名不能为空")
    private String tableName;

    @ApiModelProperty(value = "表中文名")
    @NotEmpty(message = "表中文名不能为空")
    private String tableCname;

    @ApiModelProperty(value = "接口名称")
    private String apiAlias;

    @NotBlank
    @ApiModelProperty(value = "包路径")
    private String pack;
    @NotBlank
    @ApiModelProperty(value = "模块名")
    private String moduleName;

    @NotBlank
    @ApiModelProperty(value = "前端文件路径")
    private String path;

    @ApiModelProperty(value = "前端文件路径")
    private String apiPath;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "表前缀")
    private String prefix;

    @ApiModelProperty(value = "是否覆盖")
    private Boolean cover = false;

}
